from  PyQt5.QtWidgets import *
import sys
class Maindemo(QWidget):
    def __init__(self,parent=None):
        super().__init__(parent)
        self.setWindowTitle('内置信号的槽函数')
        self.resize(300,50)
        btn=QPushButton('关闭',self)
        btn.clicked.connect(self.close)
if __name__ == '__main__':
    app=QApplication(sys.argv)
    win=Maindemo()
    win.show()
    sys.exit(app.exec_())